<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>
<%@ include file="/pub/includ.jsp"%>
<%
	List layouts = (List)request.getAttribute("layouts");
	List lfs = (List)request.getAttribute("lfs");
	com.wing.cms.domain.Channel channel = (com.wing.cms.domain.Channel)request.getAttribute("channel");
%>
<script type="text/javascript">

       	$(document).ready(function(){
      		$.formValidator.initConfig({formid:"channelform",alertmessage:false,onerror:function(msg){alert(msg)}});
      		$("#channel_name").formValidator({empty:"true"}).inputValidator({min:1,max:50,onerror:"频道名称过长，请确认"});
      		$("#order_num").formValidator({}).inputValidator({min:1,max:3,onerror:"排序号必须在0-999之间，请确认"}).regexValidator({regexp:"^[0-9]*$",onerror:"排序号错误"});
      		$("#remarks").formValidator({empty:"true"}).inputValidator({min:1,max:60,onerror:"备注过长，请确认"}); 
		});
	
	  var save = function(){
			var flag = "failure";
			if($.formValidator.pageIsValid()){
			var options = {
				type: 'POST',
				async: false,
				dataType: 'content-type',
				success: function(msg) {
					flag = msg;
				}
			}
			$('#channelform').ajaxSubmit(options);
			}
			return flag;
		}
		
		
		
</script>
<form id="channelform"  action="<%=path %>/cms/channel/save" method="post" target="_self">
<table><tr><td height="2px"></td></tr></table>
<table align="center" border="0" cellpadding="0" cellspacing="1" class="table_nbw" >
	<tr >
		<td align="right" width="30%"  style="background-color:fff;height:25px;">频道名称</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw"  type="text" id="channel_name" name="channel_name" value="${channel.channel_name}"></td>
	</tr>
	<tr >
		<td align="right" style="background-color:fff;height:25px;">静态化</td>
		<td align="left" style="background-color:fff">&nbsp;
			<input type="radio" value="0" checked="checked" name="ispub" />否&nbsp;&nbsp;
			<input type="radio" value="1" <%if(channel.getIspub()==1){ %>checked="checked" <%} %>name="ispub" />是
		</td>
	</tr>
	<tr >
		<td align="right" style="background-color:fff;height:25px;">皮肤</td>
		<td align="left" style="background-color:fff">&nbsp;<select name="lookandfeel" class="select_nbw" style="width: 200px">
				<%for(int i=0;i<lfs.size();i++){
					Map map = (Map)lfs.get(i);
				%>
					<option <%if(((String)map.get("id")).equals(channel.getLookandfeel())){ %> selected="selected" <%} %> value="<%=map.get("id") %>"><%=map.get("name") %></option>
				<%
				}
				%>
			</select>
		</td>
	</tr>
	<tr >
		<td align="right" style="background-color:fff;height:25px;">框架</td>
		<td align="left" style="background-color:fff">&nbsp;<select name="layout" class="select_nbw" style="width: 200px">
				<%for(int i=0;i<layouts.size();i++){
					Map map = (Map)layouts.get(i);
				%>
					<option <%if(((String)map.get("id")).equals(channel.getLayout())){ %> selected="selected" <%} %> value="<%=map.get("id") %>"><%=map.get("name") %></option>
				<%
				}
				%>
			</select>
	</tr>
	<tr >
		<td align="right" style="background-color:fff;height:25px;">排序号</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw"  type="text" id="order_num" name="order_num" value="${channel.order_num}"><span style="color:red;font-weight:bold">*</span></td>
	</tr>
	<tr >
		<td align="right" style="background-color:fff;height:25px;">备注</td>
		<td align="left" style="background-color:fff">&nbsp;<textarea rows="6" cols="27" class="textfiled_nbw"  type="text" id="remarks" name="remarks" >${channel.remarks}</textarea></td>
	</tr>
</table>
<table width="100%">
	<tr>
		<td align="center">
			<input type=hidden name="id" value="${channel.id}" />
			<input type=hidden name="valid_flag" value="${channel.valid_flag}" />
			<input type=hidden name="pid" value="${channel.pid}" />
			<input type=hidden name="site_id" value="${channel.site_id}" />
			<input type=hidden name="ispub" value="${channel.ispub}" />
		</td>
	</tr>
</table>
</form>


